import java.util.Scanner;

/**
 * @author zhaoqian
 * @create 2021/8/27 16:25
 */
public class test1 {
    public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
        while (in.hasNext()) {
        int str = in.nextInt();
        System.out.println(demo(str));
    }
    }
    public static int demo(int a){
        int num=0;
        for (int n=32;n>-1;n--){
            double pow = Math.pow(2, n);
            if(pow<=a){
                num++;
                a= (int) (a-pow);
                if (a==0){
                    return num;
                }
            }
        }
        return num;
    }
}
